using System;
using System.Collections.Generic;
using System.Text;

using Peradigm.Framework.Domain.Security;
using Peradigm.Framework.Persistence;

namespace Liberty.Domain.ServiceMemberManagement
{
    [Serializable]
    public class Rank : ReferenceValue
    {
        #region Constants
        #endregion

        #region Event Handlers
        #endregion

        #region Methods
        /// <summary>
        /// Creates a stubbed rank populated with frequently used primitives.
        /// Other aggregated objects are not populated by this factory method.
        /// </summary>
        /// <returns></returns>
        public static Rank TestInstance()
        {
            return new Rank( 12L, PersistentModel.NEW_VERSION, "Test Rank Instance", ReferenceValue.DEFAULT_RANKING, ReferenceValue.DEFAULT_STATUS,
                "SgtMajMC",
                Branch.TestInstance(), 
                "E9",
                "Sergeant Major of the Marine Corps",
                "Enlisted" );
        }
        #endregion

        #region Properties
        public string Abbreviation
        {
            get
            {
                return i_Abbreviation;
            }
            set
            {
                i_Abbreviation = value;
            }
        }

        public Branch BranchOfService
        {
            get
            {
                return i_BranchOfService;
            }
            set
            {
                i_BranchOfService = value;
            }
        }

        public string PayGrade
        {
            get
            {
                return i_PayGrade;
            }
            set
            {
                i_PayGrade = value;
            }
        }

        public string RankName
        {
            get
            {
                return this.Description;
            }
            set
            {
                this.Description = value;
            }
        }

        public string RankStructure
        {
            get
            {
                return i_RankStructure;
            }
            set
            {
                i_RankStructure = value;
            }
        }
        #endregion

        #region Private Methods
        #endregion

        #region Private Properties
        #endregion

        #region Construction and Finalization
        public Rank( string description, long ranking, bool active, string abbreviation, Branch branchOfService, string payGrade, string rankName, string rankStructure )
            : base( description, ranking, active )
        {
            this.Abbreviation = abbreviation;
            this.BranchOfService = branchOfService;
            this.PayGrade = payGrade;
            this.RankName = rankName;
            this.RankStructure = rankStructure;
        }

        public Rank( long oid, byte[] rowLock, string description, long ranking, bool active, string abbreviation, Branch branchOfService, string payGrade, string rankName, string rankStructure )
            : base( oid, rowLock, description, ranking, active )
        {
            this.Abbreviation = abbreviation;
            this.BranchOfService = branchOfService;
            this.PayGrade = payGrade;
            this.RankName = rankName;
            this.RankStructure = rankStructure;
        }
        #endregion

        #region Data Elements
        private string i_Abbreviation;
        private Branch i_BranchOfService;
        private string i_PayGrade;
        private string i_RankStructure;
        #endregion
    }//end Rank
}//end namespace ServiceMemberManagement
